<template>
	<view>
		<!-- <u-navbar :is-back="true" :is-fixed="true" title="基地详情"></u-navbar> -->
		<view>
			<u-field v-model="agricultureUserId_dictText" :border-bottom="false" label-width="170" label="企业名称："
				:disabled="true" input-align="right" :field-style="placeholderStyle">
			</u-field>
			<u-field v-model="baseName" :border-bottom="false" label="基地名称：" label-width="180" :disabled="true"
				input-align="right" :field-style="placeholderStyle"></u-field>

			<u-field v-model="contacts" :border-bottom="false" label="联系人：" label-width="180" :disabled="true"
				input-align="right" :field-style="placeholderStyle"></u-field>

			<u-field v-model="phone" :border-bottom="false" :disabled="true" label="联系电话：" label-width="140"
				input-align="right" :field-style="placeholderStyle"></u-field>

			<u-field v-model="baseAddress" :border-bottom="false" :disabled="true" label-width="180" label="基地位置："
				input-align="right" :field-style="placeholderStyle"></u-field>

			<u-field v-model="baseArea" :border-bottom="false" :disabled="true" label-width="200" label="基地面积(m²)："
				input-align="right" :field-style="placeholderStyle"></u-field>
			<u-field v-model="productIntroduce" :border-bottom="false" :disabled="true" label-width="200"
				label="基地产品介绍：" input-align="right" :field-style="placeholderStyle"></u-field>
			<free-list-item title="基地照片：" :showRight="false" :showLeftIcon="false" :showRightIcons="false">
				<img slot="right" :src="getFullImageUrl(basePhoto)" size="100" style="width: 100px; height: 80px"></img>
			</free-list-item>
		</view>
	</view>
</template>

<script>
	import ferrButton from '@/components/free-ui/ferr-button.vue'
	import freeListItem from '@/components/free-ui/free-list-item.vue'
	import freeAvater from '@/components/free-ui/free-avater.vue'
	import $H from '@/common/free-lib/request.js'
	import {
		getImageUrl
	} from '@/common/free-lib/util.js';
	export default {
		components: {
			ferrButton,
			freeListItem,
			freeAvater,
		},
		data() {
			return {
				mobile: '测试奢侈',
				placeholderStyle: {
					color: '#999',
				},
				agricultureUserId: '',
				baseAddress: '',
				estimatedOutput: 0,
				id: '',
				listingTime: '',
				phone: '',
				productInformId: '',
				productName: '',
				productSpecs: '',
				remark: '',
				state: '',
				title: '',
				baseArea: '',
				baseName: '',
				basePhoto: '',
				contacts: '',
				createTime: '',
				productIntroduce: '',
				agricultureUserId_dictText: '',
			}
		},
		computed: {},
		onLoad(options) {
			if (options.item) {
				// TODO: 详情对接
				// const str = options.type === 'pre' ? 'listingPreview' : 'listingBriefing'
				const obj = JSON.parse(options.item || {})
				this.agricultureUserId = obj['agricultureUserId'] || '-'
				this.baseAddress = obj['baseAddress'] || '-'
				this.estimatedOutput = obj['estimatedOutput'] || '-'
				this.listingTime = obj['listingTime'] || '-'
				this.phone = obj['phone'] || '-'
				this.productInformId = obj['productInformId'] || '-'
				this.productName = obj['productName'] || '-'
				this.productSpecs = obj['productSpecs'] || '-'
				this.remark = obj['remark'] || '-'
				this.state = obj['state'] || '-'
				this.title = obj['title'] || '-'
				this.baseArea = obj['baseArea'] || '-'
				this.baseName = obj['baseName'] || '-'
				this.basePhoto = obj['basePhoto'] || '-'
				this.contacts = obj['contacts'] || '-'
				this.createTime = obj['createTime'] || '-'
				this.productIntroduce = obj['productIntroduce'] || '-'
				this.agricultureUserId_dictText = obj['agricultureUserId_dictText'] || '-'
			}
		},
		methods: {
			getFullImageUrl(imagePath) {
				return getImageUrl(imagePath);
			},
		},
	}
</script>

<style></style>